/*
using MyGeneration/Template/NHibernate (c) by lujan99@usa.net
*/
using System;
using System.Collections;
using System.Collections.Generic;

namespace OpenGado.DATA.Entities
{
	/// <summary>
	/// Vendor object for NHibernate mapped table 'vendor'.
	/// </summary>
	[Serializable]
	public class Vendor
	{
		#region Member Variables
		protected int _vendorid;
		protected string _vendorname;
		protected string _vendorremarks;
		protected string _vendorfax;
		protected string _vendorwebsite;
		protected IList<Contact> _contact;
		protected IList<Product> _product;
		protected IList<PurchaseOrderItems> _purchaseorderitems;
		protected IList<PurchaseOrders> _purchaseorders;
		#endregion
		#region Constructors
			
		public Vendor() {}
					
		public Vendor(string vendorname, string vendorremarks, string vendorfax, string vendorwebsite) 
		{
			this._vendorname= vendorname;
			this._vendorremarks= vendorremarks;
			this._vendorfax= vendorfax;
			this._vendorwebsite= vendorwebsite;
		}

		#endregion
		#region Public Properties
		public int VendorId
		{
			get { return _vendorid; }
			set {_vendorid= value; }
		}
		public string VendorName
		{
			get { return _vendorname; }
			set {_vendorname= value; }
		}
		public string VendorRemarks
		{
			get { return _vendorremarks; }
			set {_vendorremarks= value; }
		}
		public string VendorFax
		{
			get { return _vendorfax; }
			set {_vendorfax= value; }
		}
		public string VendorWebsite
		{
			get { return _vendorwebsite; }
			set {_vendorwebsite= value; }
		}
		public IList<Contact> Contact
		{
			get { return _contact; }
			set {_contact= value; }
		}
		public IList<Product> Product
		{
			get { return _product; }
			set {_product= value; }
		}
		public IList<PurchaseOrderItems> PurchaseOrderItems
		{
			get { return _purchaseorderitems; }
			set {_purchaseorderitems= value; }
		}
		public IList<PurchaseOrders> PurchaseOrders
		{
			get { return _purchaseorders; }
			set {_purchaseorders= value; }
		}
		#endregion
		
		#region Equals And HashCode Overrides
		/// <summary>
		/// local implementation of Equals based on unique value members
		/// </summary>
		public override bool Equals( object obj )
		{
			if( this == obj ) return true;
			if( ( obj == null ) || ( obj.GetType() != this.GetType() ) ) return false;
			Vendor castObj = (Vendor)obj;
			return ( castObj != null ) &&
			this._vendorid == castObj.VendorId;
		}
		/// <summary>
		/// local implementation of GetHashCode based on unique value members
		/// </summary>
		public override int GetHashCode()
		{
			int hash = 57;
			hash = 27 * hash * _vendorid.GetHashCode();
			return hash;
		}
		#endregion
		
	}
}
